#include "UnitTest.h"


static u32 __stdcall ThreadProc( void *arg )
{
    for ( u32 i = 0; i < 2; ++i )
    {
        FileStream fileStream( "..\\Binary\\TestStream.exe", Stream::ACCESS_READ, true );
        
        MemStream memStream( fileStream.GetSize() );
        fileStream.Read( memStream.GetBufPtr(), fileStream.GetSize() );

        MemStream memStreamB( &memStream );
    }

    return 0;
}

DCL_UNITTEST( TestStream )
{
    const u32 cThreadNum = 16;
    Thread* threads = new Thread[cThreadNum];
    
    for ( u32 i = 0; i < cThreadNum; ++i )
    {
        char name[256];
        sprintf_s( name, 256, "TestTimer - %d", i );

        threads[i].Create( ThreadProc, (void *)i, name );
    }

    delete[] threads;
}